import React, { PureComponent } from 'react';
import { connect } from 'dva';
import { Layout } from 'antd';
import { GlobalHeader, GlobalFooter, Menu } from 'components';

const { Content, Header, Footer, Sider } = Layout;

@connect(({ global }) => global)
class BasicLayout extends PureComponent {
  render() {
    const { menu } = this.props;

    return (
      <Layout>
        <Header>
          <GlobalHeader />
        </Header>
        <Layout>
          <Sider width={270}>
            <Menu menuList={menu} />
          </Sider>
          <Content>{this.props.children}</Content>
        </Layout>
        <div style={{ height: '50px' }} />
        <Footer style={{ padding: 0 }}>
          <GlobalFooter />
        </Footer>
      </Layout>
    );
  }
}
export default BasicLayout;

